﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Xml;
using System.Xml.Linq;

namespace EAISimulatedWebService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together.
    public class Service1 : createProposalservice
    {
        public XElement crt(XElement value)
        {
            //return string.Format("You entered: {0}", value);
            //var result = new XmlDocument();
            XNamespace dc = "http://createProposal.msp.csc";
            var in0 = new XElement(dc + "in0");
            in0.Add(new XElement("Sample", "Hello"));
            in0.Add(new XElement("Sample2", "中文"));
            return in0;

            //return "<in0 xmlns=\"http://createProposal.msp.csc\"><BRANCH xmlns=\"urn:BeanService\">abc</BRANCH><COMMITFLAG xsi:nil=\"true\" xmlns=\"urn:BeanService\"/><COMPANY xsi:nil=\"true\" xmlns=\"urn:BeanService\"/><IGNOREDRIVERHELD xsi:nil=\"true\" xmlns=\"urn:BeanService\"/><LANGUAGE xsi:nil=\"true\" xmlns=\"urn:BeanService\"/><OBJECTID xsi:nil=\"true\" xmlns=\"urn:BeanService\"/><PASSWORD xsi:nil=\"true\" xmlns=\"urn:BeanService\"/><POLST xsi:nil=\"true\" xmlns=\"urn:BeanService\"/><USRPRF xsi:nil=\"true\" xmlns=\"urn:BeanService\"/><VERBID xsi:nil=\"true\" xmlns=\"urn:BeanService\"/><XSUPPRESSRCLRSC xsi:nil=\"true\" xmlns=\"urn:BeanService\"/></in0>";
            //return result;
        }

        public object crt(object value)
        {
            //return string.Format("You entered: {0}", value);
            //var result = new XmlDocument();
            return new XElement("root");
            //return "<in0 xmlns=\"http://createProposal.msp.csc\"><BRANCH xmlns=\"urn:BeanService\">abc</BRANCH><COMMITFLAG xsi:nil=\"true\" xmlns=\"urn:BeanService\"/><COMPANY xsi:nil=\"true\" xmlns=\"urn:BeanService\"/><IGNOREDRIVERHELD xsi:nil=\"true\" xmlns=\"urn:BeanService\"/><LANGUAGE xsi:nil=\"true\" xmlns=\"urn:BeanService\"/><OBJECTID xsi:nil=\"true\" xmlns=\"urn:BeanService\"/><PASSWORD xsi:nil=\"true\" xmlns=\"urn:BeanService\"/><POLST xsi:nil=\"true\" xmlns=\"urn:BeanService\"/><USRPRF xsi:nil=\"true\" xmlns=\"urn:BeanService\"/><VERBID xsi:nil=\"true\" xmlns=\"urn:BeanService\"/><XSUPPRESSRCLRSC xsi:nil=\"true\" xmlns=\"urn:BeanService\"/></in0>";
            //return result;
        }

        //public CompositeType GetDataUsingDataContract(CompositeType composite)
        //{
        //    if (composite == null)
        //    {
        //        throw new ArgumentNullException("composite");
        //    }
        //    if (composite.BoolValue)
        //    {
        //        composite.StringValue += "Suffix";
        //    }
        //    return composite;
        //}
    }
}